﻿using System.Windows.Input;

namespace XEvolve.Presentation.Input.Internal
{
    internal class CommandHandler
    {
        private readonly ICommandHandler handler;

        internal CommandHandler(ICommandHandler handler)
        {
            this.handler = handler;
        }

        internal void Execute(object sender, ExecutedRoutedEventArgs args)
        {
            handler.Execute(sender, args.Parameter);
        }

        internal void CanExecute(object sender, CanExecuteRoutedEventArgs args)
        {
            args.CanExecute = handler.CanExecute(sender, args.Parameter);
        }
    }
}
